Consider this triangle.
Shading a Triangle
R(4, 8), color = (1, 0, 0)
P(0, 0)
color = (1, 1, 0)
Q(12, 0)
color = (0, 1, 1)